package ccgl.com.dao;

import java.sql.Connection;
import java.sql.SQLException;

import ccgl.com.dao.common.BaseDao;
import ccgl.com.factory.ConnectionFactory;
import ccgl.com.model.MUser;

/**
 * 商品管理Dao
 * 
 * @author Administrator
 * 
 */
public class LoginDao extends BaseDao<MUser> {

	public MUser checkUser(String username, String password)
			throws SQLException {
		String sql = "select * from user where username='" + username
				+ "' and password='" + password + "'";
		Connection con = ConnectionFactory.getConnection();
		try {
			return super.queryForObject(sql, con);
		} finally {
			try {
				if (con != null) {
					con.close();
				}
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
	}

}
